<template>
    <div>
      <second-center :list="centerList"></second-center>
      <my-vedio :list="vedio"></my-vedio>
    </div>
</template>

<script>
import SecondCenter from './components/center'
import MyVedio from './components/vedio'
import axios from 'axios'
export default {
  name: 'Second',
  components: {
    SecondCenter,
    MyVedio
  },
  data () {
    return {
      centerList: [],
      vedio: []
    }
  },
  methods: {
    getSecondInfo () {
      axios.get('http://huang.ngrok.xiaomiqiu.cn/api/second.json')
        .then(this.getSecondInfoSucc)
    },
    getSecondInfoSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.centerList = data.centerList
        this.vedio = data.vedio
      }
    }
  },
  mounted () {
    this.getSecondInfo()
  },
  activated () {
    this.getSecondInfo()
  }
}
</script>

<style>

</style>
